import getApiData from "@/services/cpasRequest";


// 获取账套
export async function getAccountInfo(params: {
  dbname: string;
}) {
  if (!params.dbname) return [];
  const res = await getApiData("account.accountInfo.getDataList", params);
  if (res.ok) {
    return Promise.resolve({
      data: res.data,
      success: true,
    });
  }
  return Promise.resolve({
    data: [],
    success: false,
  });
}
// 获取指定账套ID的科目的节点的上级节点
export async function getSubjectParentList(params: {
  dbname: string;
  Data_ID: string;
  PKMBH: string;
}) {
  const res = await getApiData("account.subject.getDataParentList", params);
  return Promise.resolve({
    data: res.data,
    success: res.ok,
  });
}
